# utils/cleaning.py

import pandas as pd

def clean_precipitation_data(records):
    """
    清理降水数据：
    - 删除 PRE_1h 为空或等于 "99999" 的记录。
    
    参数：
    records (list of dict): 原始数据记录列表。
    
    返回：
    list of dict: 清理后的数据记录列表。
    """
    cleaned_records = []
    for item in records:
        pre_1h = item.get("PRE_1h", "").strip()
        if pre_1h == "" or pre_1h == "999999" or pre_1h == "99999":
            continue  # 跳过无效记录
        cleaned_records.append(item)
    return cleaned_records
